<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/diaShop/css/common.css" rel="stylesheet" type="text/css"/>
    <link href="/diaShop/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/diaShop/fonts/iconfont.css" rel="stylesheet" type="text/css"/>
    <script src="/diaShop/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/diaShop/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
    <script src="/diaShop/js/common_js.js" type="text/javascript"></script>
    <script src="/diaShop/js/footer.js" type="text/javascript"></script>
    <script src="/diaShop/js/lrtk.js" type="text/javascript"></script>
    <title>用户登陆</title>
</head>

<body>
<div class="log_bg">
    <div class="top">
        <div class="logo">
            <div class="logo_link"><a href="/diaShop/index"><img src="/diaShop/images/logo.png"></a></div>
            <div class="phone">免费咨询热线：<b>400-567-4556</b></div>
        </div>
    </div>
    <div class="login">
        <div class="log_img"><img src="/diaShop/images/imgbg_03.png" width="611" height="425"></div>
        <div class="log_c">
            <form id="signupForm">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr height="50" valign="top">
                        <td width="55">&nbsp;</td>
                        <td>
                            <span class="fl" style="font-size:24px;">登录</span>
                            <span class="fr">还没有商城账号，<a href="/diaShop/reg" style="color:#ff4e00;">立即注册</a></span>
                        </td>
                    </tr>
                    <tr height="70">
                        <td>用户名</td>
                        <td><input type="text" id="username" name="username" value="admin" class="l_user"></td>
                    </tr>
                    <tr height="70">
                        <td>密&nbsp; &nbsp; 码</td>
                        <td><input type="password" id="password" name="password" value="admin" class="l_pwd"></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td style="font-size:12px; padding-top:20px;">
                	<span style="font-family:'宋体';" class="fl">
                    	<label class="r_rad"><input type="checkbox"></label><label class="r_txt">请保存我这次的登录信息</label>
                    </span>
                            <span class="fr"><a href="javascript:void(0)" style="color:#ff4e00;">忘记密码</a></span>
                        </td>
                    </tr>
                    <tr height="60">
                        <td>&nbsp;</td>
                        <td>
                            <button class="log_btn">登录</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
    <div class="btmbg">
        <div class="btm">
            备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 ,
            Technical Support: Dgg Group <br>

        </div>
    </div>
</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>


<!-- jQuery Validation plugin javascript-->
<script src="/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/js/plugins/validate/messages_zh.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        validateRule();
        //$("#signupForm").validate();
    });
    $.validator.setDefaults({
        submitHandler: function () {
            login();
        }
    });

    function login() {
        console.log($('#signupForm').serialize());
        $.ajax({
            type: "POST",
            url: "/diaShop/login",
            data: $('#signupForm').serialize(),
            success: function (r) {
                if (r.code == 0) {
                    location.href = '/diaShop/index';
                } else {
                    layer.msg(r.msg);
                }
            }
        });
    }

    function validateRule() {
        $("#signupForm").validate({
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true
                }
            },
            messages: {
                username: {
                    required: "请输入您的用户名",
                },
                password: {
                    required: "请输入您的密码",
                }
            }
        })
    }
</script>
</body>
</html>
